
import { createI18n } from "vue-i18n"

import messages from '@/lang/index'

import { useAppStore } from '@/store/modules/app'

const i18n = createI18n({
	locale: uni.getLocale(),
	messages,
	fallbackLocale: 'en'//回退语言
})


export const setLanguage = (lang : any) => {
	const  {setLang}=useAppStore()
	setLang(lang)
	i18n.global.locale = lang
}


export default i18n